Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function GetHashCode( _ ByVal bytes() As Byte _ ) As Integer |
Parameters
- bytes
Library/Library.Test/TestBinaryComparer.cs
C# | Copy Code |
---|---|
Assert.AreEqual(0, BinaryComparer.GetHashCode(null)); Assert.AreEqual(0, BinaryComparer.GetHashCode(new byte[] { })); Assert.AreEqual(BinaryComparer.GetHashCode(new byte[] { 1, 2, 3 }), BinaryComparer.GetHashCode(new byte[] { 1, 2, 3 })); Assert.AreNotEqual(BinaryComparer.GetHashCode(null), BinaryComparer.GetHashCode(new byte[] { 1, 2, 3 })); Assert.AreNotEqual(BinaryComparer.GetHashCode(new byte[] { 1, 2, 3 }), BinaryComparer.GetHashCode(null)); Assert.AreNotEqual(BinaryComparer.GetHashCode(new byte[] { 1, 2 }), BinaryComparer.GetHashCode(new byte[] { 1, 2, 3 })); Assert.AreNotEqual(BinaryComparer.GetHashCode(new byte[] { 1, 2, 3 }), BinaryComparer.GetHashCode(new byte[] { 1, 2 })); |
VB.NET | Copy Code |
---|---|
Assert.AreEqual(0, BinaryComparer.GetHashCode(Nothing)) Assert.AreEqual(0, BinaryComparer.GetHashCode(New Byte() {})) Assert.AreEqual(BinaryComparer.GetHashCode(New Byte() {1, 2, 3}), BinaryComparer.GetHashCode(New Byte() {1, 2, 3})) Assert.AreNotEqual(BinaryComparer.GetHashCode(Nothing), BinaryComparer.GetHashCode(New Byte() {1, 2, 3})) Assert.AreNotEqual(BinaryComparer.GetHashCode(New Byte() {1, 2, 3}), BinaryComparer.GetHashCode(Nothing)) Assert.AreNotEqual(BinaryComparer.GetHashCode(New Byte() {1, 2}), BinaryComparer.GetHashCode(New Byte() {1, 2, 3})) Assert.AreNotEqual(BinaryComparer.GetHashCode(New Byte() {1, 2, 3}), BinaryComparer.GetHashCode(New Byte() {1, 2})) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
BinaryComparer ClassBinaryComparer Members
Overload List